package com.keldor.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

import com.keldor.model.Articulo;

public class ArticuloMapper implements RowMapper<Articulo> {
   public Articulo mapRow(ResultSet rs, int rowNum) throws SQLException {
      Articulo articulo = new Articulo();
      articulo.setCod_articulo(rs.getInt("cod_articulo"));
      articulo.setId_almacen(rs.getInt("id_almacen"));
      articulo.setNombre(rs.getString("nombre"));
      articulo.setPrecio(rs.getFloat("precio"));
      articulo.setStock(rs.getInt("stock"));
      return articulo;
   }
}